home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 248 / 248.d81 / t.db+ doc 1 < prev    next >
Text File  |  2022-08-26  |  15KB  |  582 lines

  1. u
  2.  
  3.             DOTBASIC PLUS
  4.  
  5.          Program and Text by
  6.       Dave Moorman and Lee Novak
  7.  
  8.  
  9.     We at LOADSTAR are pleased to
  10. offer the ultimate software develop-
  11. ment package for the Commodore 64:
  12. DotBASIC Plus. I need to thank Lee
  13. Novak for Mr.Mouse 2.1, which is the
  14. backbone of this unique Object
  15. Oriented BASIC Extension. And a big
  16. thanks goes to Jeff Jones for his help
  17. in this project. Without it, DotBASIC
  18. Plus would have been quite different.
  19. He stopped Lee from making a couple of
  20. BIG mistakes, and even some of his
  21. ideas are among this mess of code.
  22.  
  23.     Programs written with DotBASIC
  24. Plus automatically support both a
  25. mouse in port 1 and a joystick in port
  26. 2. The FIRE button on the joystick is
  27. the same as the left mouse button. For
  28. joystick users, any key can be defined
  29. to replace the missing right mouse
  30. button. The middle button (on CMD's
  31. SmartMouse) will double the mouse's
  32. speed.
  33.  
  34.     DB+ automatically creates a boot
  35. program (with a "B." prefix) that
  36. loads all necessary files, and creates
  37. a template DotBASIC program (with a
  38. ".DBS" extension) that will be your
  39. main BASIC code. Also, MOUSE2.1 7K
  40. 1000 is copied to your work disk,
  41. along with the DotBASIC ML code (with
  42. a ".DML" extension).
  43.  
  44.  
  45.  GETTING STARTED
  46.  ---------------
  47.  
  48.     The DB+ development system will
  49. work with one or two disk drives. With
  50. two drives, you will put the DB+ disk
  51. in one and your formated Work disk in
  52. the other. Or, you can use a single
  53. drive, and save your work to the DB+
  54. disk for later copying to its own disk
  55. (using your own file copier). Don't
  56. forget to copy DB+ to a library disk
  57. first! In this documentation, we will
  58. use the variable DB to indicate the
  59. DB+ drive and DW to indicate the Work
  60. drive.
  61.  
  62.     LOAD"B.DOTBASIC",DB and RUN it.
  63. You will be asked which drives your
  64. disk(s) are on, followed by a Y/N
  65. confirmation of each. Then you will
  66. input the name of your project (no
  67. extensions, please). The necessary
  68. files are renamed to your project name
  69. and copied to your Work drive. Then
  70. your project is RUN. You will see the
  71. mouse arrow for a second, then a READY
  72. prompt in white. You are now ready to
  73. program in DotBASIC Plus!
  74.  
  75.  
  76.  FEATURES
  77.  --------
  78.  
  79.     MV is now a system variable,
  80. pointing to the start of the variable
  81. zone, which is just a place where
  82. certain user-accessible settings and
  83. other data are held. You will use POKE
  84. MV + OFFSET to change how some of the
  85. commands work.
  86.  
  87.     Let's go over some of the features
  88. of DB+. First off, the keyboard still
  89. can mimic the mouse buttons.
  90.  
  91.  
  92.   MV+14  Right Keycode    (F7 = 3)
  93.   -----
  94.  
  95.     MV+14 holds the keyboard
  96. equivalent to the right mouse button,
  97. which is defined as F7, but you could
  98. change it if you've assigned a
  99. function to the right mouse button and
  100. would like to use F7 (and F8) as
  101. hotkeys instead.
  102.  
  103.     Note that MV+14 is not an ASCII
  104. code. "Keycodes" are generated by the
  105. SCNKEY routine during the interrupt.
  106. They can be determined with this
  107. one-line program:
  108.  
  109.    10 print peek(203):goto 10
  110.  
  111.     When you RUN it, hold down the key
  112. you want to designate as a button and
  113. note the number showing. Be aware that
  114. keycodes are not affected by the
  115. special (SHIFT/CMDR/CTRL) keys, and
  116. these special keys don't have keycodes
  117. - so they can't be used as mouse
  118. buttons.
  119.  
  120.   MV+18 Keyboard Enable (default 129)
  121.   -----
  122.          +128 = Return can click
  123.          +64  = Space can click
  124.          +32  = Commodore can click.
  125.          +1   = CRSR keys move arrow
  126.  
  127.     Even the CRSR keys can control the
  128. arrow pointer around the screen. This
  129. makes it especially easy to add
  130. "keyboard support" to your programs
  131. without having to think about it. By
  132. default, the RETURN key serves as the
  133. left mouse button.
  134.  
  135.     With a POKE, you could enable the
  136. COMMODORE key to also serve as the
  137. left mouse button. This would be
  138. useful for any "click and drag"
  139. situations within your program, only
  140. because the Commodore key can be read
  141. independently of the CRSR keys. It is
  142. awkward to use, but it works. RETURN
  143. or SPACE can be used to "click" the
  144. rest of the time. It's more natural.
  145.  
  146.  
  147.   ON and OFF
  148.   ----------
  149.   SYS DD -- ON
  150.   .OF    -- OFF
  151.  
  152.     When you LIST your DBS program,
  153. you will see SYS DD (DD=14336 -- the
  154. beginning of the DB+ ML code) which
  155. turns on DB+. It also sets the CPU-NMI
  156. vector at $FFFA/B to point to an RTI.
  157. This prevents a RESTORE-key crash
  158. while the ROMs are out.
  159.  
  160.     .OF turns DB+ off. The old IRQ
  161. vector is saved and later restored.
  162.  
  163.     SYS DD initializes the CAGE to
  164. 0,0,40,25 (the whole screen). It also
  165. sets the variable MV+20 to 129. This
  166. takes care of users who might break
  167. out of your program during a menu,
  168. since MV+20 and the cage usually have
  169. different values during menus.
  170.  
  171.  
  172.   MINOR CONSIDERATION
  173.   -------------------
  174.  
  175.     When using a DB+ command after
  176. THEN, you must precede it with a
  177. colon:
  178.  
  179.  100 IF A=10 THEN:.BG,2
  180.  
  181.  
  182.   EASY SPRITE
  183.   -----------
  184.   .QS
  185.   .QR
  186.  
  187.     When DB+ is started, an arrow is
  188. created (sprite at 46*256). You can
  189. turn off the arrow and mouse control
  190. at anytime with .QS, and turn it back
  191. on with .QR. These names stand for IRQ
  192. Suspend and IRQ Restore. The IRQ and
  193. sprites are turned off with .QS and
  194. restored with .QR. Occasionally, a
  195. disk access command will turn off the
  196. mouse. Use .QR to restore it.
  197.  
  198.     Sprite zero is enabled as a
  199. regular-size, high resolution, white
  200. mouse pointer with priority over the
  201. background. You can use Sprite Edit
  202. (soon to be released with the DB+
  203. Package) to change the look of your
  204. pointer.
  205.  
  206.    Related Variable:
  207.  
  208.   MV+17  Twin Flag   (default is 128)
  209.  
  210.     A Twin Flag setting of 128 (or
  211. higher) will cause sprite 1 to be
  212. enabled as a black shadow arrow. After
  213. that, it is the interrupt's job to
  214. ensure the shadow arrow follows the
  215. other sprite. The Twin Flag may be set
  216. to these values:
  217.  
  218.      0 = Single sprite only
  219.    128 = Dual sprite,shadow  x+2,y+1
  220.    192 = Dual sprite, perfect sync
  221.  
  222.     Although 192 would cause the
  223. shadow sprite to be directly under the
  224. pointer sprite, and thus unseen, there
  225. ARE other uses for this feature. The
  226. sprites don't have to share the same
  227. shape, you know.
  228.  
  229.  
  230.   ASK BASIC
  231.   ---------
  232.   .MA
  233.  
  234.     This crucial command is the only
  235. way to get feedback from the mouse!
  236. Feedback is deposited in integer
  237. variables. Here's the wealth of
  238. information you will get:
  239.  
  240.    Mouse position information
  241.  
  242.    PX%  Pixel-X location (0-319)
  243.    PY%  Pixel-Y location (0-199)
  244.    CX%  Cell-X location  (0-39)
  245.    CY%  Cell-Y location  (0-24)
  246.  
  247.    Mouse button information
  248.  
  249.    L1%  Left button    (0=up, 1=down)
  250.    R1%  Right button   (0=up, 1=down)
  251.    L2%  New left push  (0=no, 1=yes)
  252.    R2%  New right push (0=no, 1=yes)
  253.  
  254.     While L1% and R1% merely return
  255. the state of the buttons, L2% and R2%
  256. tell you if the press is NEW. This is
  257. useful for clicking on things. There
  258. are also other times when you want to
  259. do something when the button is
  260. pressed, but not continually as the
  261. user holds the button down and scoots
  262. across the screen.
  263.  
  264.     Internally, new button presses are
  265. nulled when the button is lifted or
  266. the .MA routine is called.
  267.  
  268.    Text screen information
  269.  
  270.    SC%  Screen Code under mouse
  271.    CC%  Color Code under mouse
  272.    PP%  Pointer Position of mouse
  273.  
  274.     The color data is stripped of its
  275. upper (garbage) nybble. The pointer
  276. position is the RAM location of the
  277. screen cell right under the mouse.
  278. Since PP% is an integer, values above
  279. 32767 will be negative.
  280.  
  281.    Region information
  282.  
  283.    RG%  Region # mouse is over (0-64)
  284.    CR%  Region # being clicked (0-64)
  285.  
  286.     A "region" is an area of the
  287. screen that you can define by its
  288. X,Y,Width,Height limits. RG% will be
  289. zero unless the mouse is currently
  290. over an ACTIVE region. CR% will be
  291. zero unless the user is currently
  292. left-clicking on a particular region.
  293. In the case of overlapping regions,
  294. the higher number is returned.
  295.  
  296.     The "freshness" of all mouse
  297. feedback depends on how often you are
  298. able to use .MA, and how quickly your
  299. program can respond to the data.
  300.  
  301.  
  302.   LOOPING
  303.   -------
  304.   .DO
  305.   .UN [true]
  306.   .WH [true]
  307.  
  308.     For the sake of "freshness," DB+
  309. has a very efficient Do-Loop method.
  310. .DO marks the beginning of the loop
  311. (in the processor stack -- somewhat
  312. like a FOR-NEXT loop). The two other
  313. commands, .UN and .WH are at the end
  314. of the loop area.
  315.  
  316.   100 .DO:.MA:.UN L2%
  317.  
  318.      Th